struct MY_VRRP_SESSION {
	/* Pointer to VRRP global */
	VRRP_GLOBAL_DATA *vrrp;
	/* VRID */
	int vrid;
	/* Current State. */
	vrrp_state_t state;
	/* Address family */
	u_int8_t af_type;
	/* Virtual IP Address.. */
	struct pal_in4_addr vip_v4;
	/* Master real IP address */
	struct pal_in4_addr master_ipv4;
	/* Sender IP address */
	struct pal_in4_addr sender_ipv4;
	/* IP Owner ? */
	bool_t owner;
	/* Primary IPv4 address. */
	struct pal_in4_addr primary_addr;
	/* Source IPv4 address of advertisement */
	struct pal_in4_addr adv_src_v4;
	/* Interface */
	u_int32_t ifindex;
	struct interface *ifp;
	/* priority */
	int prio;
	int conf_prio;
	/* advertisement interval */
	int adv_int;
	/* advertisement interval received from the master */
	int master_adv_int;

	/* Preempt mode */
	bool_t preempt;
	/* Virtual MAC */
	PAL_MAC_ADDR vmac;

	/* Countdown timer */
	int timer;

	/* Skew time */
	int skew_time;
	/* Master down interval */
	int master_down_int;
	/* Number of IP addresses */
	int num_ip_addrs;	
}



/* structure to hold the VRRP Packet. */
struct vrrpd_advt_info {
	/* Version & Type */
	u_int8_t ver_type;
	/* VRID. */
	u_int8_t vrid;
	/* Priority */
	u_int8_t priority;
	/* Number of IP address to backup */
	u_int8_t num_ip_addr;
	/* Auth type */
	u_int8_t auth_type;
	/* Advertisement interval */
	u_int8_t advt_int;
	/* VRRP Checksum */
	u_int16_t cksum;
	/* Virtual IP address. */
	struct pal_in4_addr vip_v4;
	/* Auth Data. */
	unsigned int auth_data[2];
}

#define MY_VRRP_ADVT_SIZE sizeof(struct vrrpd_advt_info)
#define MY_VRRP_ADVT_CHECKSUM_POS (6*sizeof(u_int8_t))

#define MY_VRRP_VERSION 2
#define MY_VRRP_ADVT_TYPE 1
/* Send ADVERTISEMENT packet */
int my_vrrp_send_advert_v2(VRRP_SESSION *sess, u_int8_t prio);

/*------------------------------------------------------------------------
 * vrrp_ip_send_advt - called to communicate with the interface/socket to
 *                      send the vrrp advertisements
 *------------------------------------------------------------------------*/
static int
_my_send_advert (struct interface *ifp, int sock, struct stream *s, int size,
              u_int8_t  af_type);







